/*
 * Selling Partner API for Orders
 * Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools.   _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response).
 *
 * OpenAPI spec version: v0
 * 
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */


package io.swagger.client.model;

import java.util.Objects;
import java.util.Arrays;
import io.swagger.annotations.ApiModel;
import com.google.gson.annotations.SerializedName;

import java.io.IOException;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;

/**
 * Details the importance of the constraint present on the item.
 */
@JsonAdapter(FulfillmentPlanConstraintType.Adapter.class)
public enum FulfillmentPlanConstraintType {
  
  MANDATORY("MANDATORY"),
  
  RECOMMENDED("RECOMMENDED");

  private String value;

  FulfillmentPlanConstraintType(String value) {
    this.value = value;
  }

  public String getValue() {
    return value;
  }

  @Override
  public String toString() {
    return String.valueOf(value);
  }

  public static FulfillmentPlanConstraintType fromValue(String text) {
    for (FulfillmentPlanConstraintType b : FulfillmentPlanConstraintType.values()) {
      if (String.valueOf(b.value).equals(text)) {
        return b;
      }
    }
    return null;
  }

  public static class Adapter extends TypeAdapter<FulfillmentPlanConstraintType> {
    @Override
    public void write(final JsonWriter jsonWriter, final FulfillmentPlanConstraintType enumeration) throws IOException {
      jsonWriter.value(enumeration.getValue());
    }

    @Override
    public FulfillmentPlanConstraintType read(final JsonReader jsonReader) throws IOException {
      String value = jsonReader.nextString();
      return FulfillmentPlanConstraintType.fromValue(String.valueOf(value));
    }
  }
}

